import Taro, { Component } from '@tarojs/taro'
import { AtIcon } from 'taro-ui'
import classnames from 'classnames'
import PropsType from 'prop-types'
import { View, Text, Image } from '@tarojs/components'
import '../styles/financingrecord.scss'

export default class DFinancingRecord extends Component {

    constructor(props){
        super(props)
        this.state={
            colorshow:['unreviewed','pass','notpass']
        }
    }
    getStatus(status) {
        return {
            $0: '待审核',
            $1: '已通过',
            $2: '未通过',
        }[`$${status}`]
    }
    getColor(status){
        console.log(colorshow[status])
    }
    render() {
        const {
            className,
            money = '+200.00万',
            time = '2019-11-11',
            status = '1',
        } = this.props
        const {
            colorshow
        } = this.state
        return (
            <View className={classnames('b_financingrecorditem', className)}>
                <View className='item_title'>
                    <View className='item_title__left'>
                        <Text>{money}</Text>
                    </View>
                    <View className='item_title__right'>
                        <Text className='item_title__right_time'>{time}</Text>
                        {/* <Text classNames='item_title__right_status'>{this.getStatus(status)}</Text> */}
                        <Text className={classnames('item_title__right_status',colorshow[+status])}>{this.getStatus(status)}</Text>

                    </View>
                </View>
            </View>
        )
    }
}

DFinancingRecord.defaultProps = {
    className: "",
    money: "+200.00万",
    time: "2019-11-11",
    status:'1'
}

DFinancingRecord.PropsType = {
    className: PropsType.oneOfType[PropsType.string, PropsType.object],
    money: PropsType.string,
    time: PropsType.array,
    status: PropsType.string
}